package com.yxdj.order.api;

import com.yxdj.common.core.constant.SecurityConstants;
import com.yxdj.common.core.constant.ServiceNameConstants;
import com.yxdj.common.core.domain.R;
import com.yxdj.order.api.domain.OrderInfo;
import com.yxdj.order.api.factory.RemoteOrderFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(contextId = "remoteOrderService", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = RemoteOrderFallbackFactory.class)
public interface RemoteOrderService {

    @GetMapping("/order/getOrderInfoById/{id}")
    R<OrderInfo> getOrderInfoById(@PathVariable("id") Long id , @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
